﻿using System;
using System.Text;
using TI_BLE_HCI_ClientLib.BaseEntities;
using TI_BLE_HCI_ClientLib.GenericHCIEntities;
using TI_BLE_HCI_ClientLib.HCIBaseEntities;

namespace TI_BLE_HCI_ClientLib.HCICommands
{
    public class HCICommand_GAP_Update_Advertising_Data : HCIVendorSpecificCommand
    {
        private const byte CMD = 0x7;

        public enum AdvertisingTypeEnum
        {
            SCANRSPData = 0,
            AdvertisementData = 1
        }

        public enum InitiatorAddrTypeEnum
        {
            ADDRTYPE_PUBLIC = 0,
            ADDRTYPE_STATIC = 1,
            ADDRTYPE_PRIVATE_NONRESOLVE = 2,
            ADDRTYPE_PRIVATE_RESOLVE = 3
        }


        public enum Return_Status
        {
            Success = 0,
            InvalidProfileRole = 0x12
        }

        public HCICommand_GAP_Update_Advertising_Data(AdvertisingTypeEnum adType, byte[] advertData)
            : base(HCIVendorSpecificCommandCSG.GAP, CMD)
        {
            var pars = new BaseEntityParameter[3];

            pars[0] = new ByteParameter((byte)adType);
            pars[1] = new ByteParameter((byte)advertData.Length);
            pars[2] = new ByteArrayParameter(advertData);

            base.addParameters(pars);
        }
    }
}
